from tkinter import *

from Shelf import *  # Database included
from Img import *


if __name__ == '__main__':

    # 操作层级 H A01 A02 B01 B02 B03

    print('shelf 0.1 on Win32')
    print('请输入要进行的操作(add, view, list):')
    a = input()
    if a == 'add':
        initlist = []
        # ('name', 'type', 'follow', 'img_name图片文件名', 'comment')
        print('请输入名称:')
        a = input()
        print('请输入类型:')
        a = input()
        print('请输入父容器名称:') # 名称唯一 可以用来获取id
        a = input()
        print('请拖入图片:')
        a = input()
        print('请输入注释:')
        a = input()

    elif a == 'view':
        print('请输入id:')
        s = Shelf(input())
        print(s.name)
        print(s.type)
        print(s.img)
        print(s.comment)

    elif a == 'list':
        print('显示容器树状结构:')


# s = Shelf(db.getshelfidbyname('容器1'))

# 写入模式输入字典
# {'name': '22', 'type': 'shelf', 'follow': 22, 'img_name': None, 'comment': None}

# s2 = Shelf(False, {'name': '写入模式名称', 'type': 'shelf', 'follow': 2, 'img_name': '没毛病.jpg', 'comment': '写入模式注释'})
#
# a = {'name': '22', 'type': 'shelf', 'follow': 22, 'img_name': None, 'comment': None}
# value_list = tuple(a.values())
# print('str')
# print(str(value_list))
# print(s.comment)



# root = Tk()
# widget = Label(None, text='Hello GUI world!')  # 参数：（父组件对象，标签配置选项）

# widget = Lable()
# widget['text'] = 'Hello GUI world!'

# widget = Label(root)
# widget.config(text='Hello GUI world!')
# widget.pack(side=TOP, expand=YES, fill=BOTH)


# root.title('1111111222')
# root.mainloop()
